home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / Sultan.dxr / scripts_5_foundation cards.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  978 b   |  31 lines

  1. property basecard, spriteNum
  2. global foundation, equal, currentselect
  3.  
  4. on beginSprite me
  5.   basecard = #ace
  6.   foundation.addProp(makesymbol(spriteNum), new(script("card pile")))
  7.   foundation[makesymbol(spriteNum)].addCard(spriteNum)
  8. end
  9.  
  10. on mouseEnter me
  11.   if (sprite(the clickOn).loc = the mouseLoc) and (the clickOn <> spriteNum) then
  12.     if foundation[makesymbol(spriteNum)].getcardcount() = 1 then
  13.       if (getlist(the clickOn).rank = string(basecard)) and (getlist(the clickOn).suit = foundation[makesymbol(spriteNum)].getlastcard().suit) then
  14.         equal = 1
  15.         currentselect = spriteNum
  16.       end if
  17.     else
  18.       if (getlist(the clickOn).rankvalue = (foundation[makesymbol(spriteNum)].getlastcard().rankvalue + 1)) and (getlist(the clickOn).suit = foundation[makesymbol(spriteNum)].getlastcard().suit) then
  19.         equal = 1
  20.         currentselect = spriteNum
  21.       end if
  22.     end if
  23.   end if
  24. end
  25.  
  26. on mouseLeave me
  27.   equal = 0
  28.   currentselect = 0
  29.   checkwin()
  30. end
  31.